import { getWbRole, getUserList } from "@/api/system/user.js";
/**获取人员类型 */
export const getWbRoleList = async (name) => {
  let list = [];
  let res = await getWbRole(name);
  if (res.code == 200) {
    list = [...res.rows];
  }
  return list;
};

/**获取人员列表 */
export const getUserLists = async (id) => {
  let list = [];
  let res = await getUserList(id);
  if (res.code == 200) {
    list = [...res.rows];
  }
  return list;
};

/**直接获取人员列表 */
export const getUsers = async (name) => {
  let data = await getWbRoleList(name);
  if (data[0]) {
    return getUserLists(data[0].roleId);
  }
};
